1. Field of the Invention
The present invention relates to superscalar reduced instruction set computers (RISC), more particularly, the present invention relates to a register renaming circuit for superscalar RISC computers.
2. Background Art
A more detailed description of some of the basic concepts discussed in this application is found in a number of references, including Mike Johnson, Superscalar Microprocessor Design (Prentice-Hall, Inc., Englewood Cliffs, N.J., 1991) (hereafter Johnson); John L. Hennessy et al., Computer Architecturexe2x80x94A Quantitative Approach (Morgan Kaufmann Publishers, Inc., San Mateo, Calif., 1990). Johnson""s text, particularly Chapters 2, 6 and 7 provide an excellent discussion of the register renaming issues addressed by the present invention.
A major consideration in a superscalar RISC processor is to how to execute multiple instructions in parallel and out-of-order, without incurring data errors due to dependencies inherent in such execution. Data dependency checking, register renaming and instruction scheduling are integral aspects of the solution. A detailed discussion of storage conflicts, register renaming and dependency mechanisms is found in commonly owned, co-pending U.S. Pat. No. 5,497,499 (hereafter referred to as the ""499 patent).
The ""499 patent discloses a register renaming circuit (RRC) having a fixed instruction window. In the fixed instruction window, dependency checking and resource assignment is done on the same set of instructions until all the instructions in the set are completed. This means that there is a fixed relationship between each instruction""s position in the instruction stream and the instruction number used for resource assignment.
For example, in an instruction stream with an instruction window of 4 instructions every fourth instruction maps to instruction A (i.e., the first instruction in the window). This technique makes re-mapping of instruction very simple. In this case a 4-to-1 multiplexer is all that is necessary for each resource to forward a single instruction to that resource. However, the fixed format requires that the instruction window be advanced by a fixed amount, which results in somewhat inefficient processing.
When an instruction retires (an instruction can retire after it has been executed without exception and when all previous instructions have been executed and their results are stored in the register file), its result is moved into a main register file (i.e., the programmable visible register file) and if any instructions were dependent on that instruction, their renamed sources are not needed anymore. In the architecture disclosed in the ""499 patent, all instructions"" sources are renamed every cycle. This renaming technique requires many comparators for performing the dependency checks. More specifically, the source register addresses of each instruction must be compared to the destination register addresses of all preceding instructions in the instruction window every cycle.
What is desired is a more efficient register renaming technique requiring less comparators and permitting the processor to execute instructions in parallel and out of order.
The present invention is directed to a system and method for performing register renaming of source registers on a per-cycle basis only for new instructions added to the instruction window in that cycle. The present invention thus reduces the total number of dependency check comparators necessary for performing register renaming.
A preferred embodiment of the present invention comprises storing the instructions in a variable advance instruction window, and assigning a tag to each instruction in the instruction window. The tag of each retired instruction is assigned to the next new instruction to be added to the instruction window. The results of instructions executed by the processor are stored in a temp buffer according to their corresponding tags to avoid output dependencies and anti-dependencies. The temp buffer therefore permits the processor to execute instructions out of order and in parallel.
Data dependency checks are performed only for each new instruction added to the instruction window. Operands of the instructions having input dependencies are often located in the temporary buffer, and the source register addresses of those instructions having dependencies are renamed according to the tags of the operands located in the temp buffer. The renamed source register addresses are then stored in a rename result register file.
The foregoing and other features and advantages of the present invention will be apparent from the following more particular description of the preferred embodiments of the invention, as illustrated in the accompanying drawings.